﻿using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ProductIntory.Domains;
using ProductIntory.ErrorCodes;
using ProductIntory.Read.Apis.Application.Command.SalesOutboundTableCommands;

namespace ProductIntory.Read.Apis.Controllers
{
    [Route("api/[controller]/[action]")]

    [ApiController]
    public class SalesOutboundTableAllController : ControllerBase
    {
        IMediator mediator;

        public SalesOutboundTableAllController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpGet]
        public async Task<ApiPaging<List<SalesOutboundTable>>> ShowSalesOutboundTable( [FromQuery] ShowSalesOutboundTableCommand request)
        {
            try
            {
                return await mediator.Send(request);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
